package com.sinopec.uhf.settings

import com.sinopec.iuhf.IUHFSettings
import com.sinopec.uhf.uhfhelp.readPower
import com.sinopec.uhf.uhfhelp.setPower8

//功率
object Power : IUHFSettings.ASeting<Int> {
    override suspend fun get(): Int {
        return readPower()
    }

    override suspend fun set(t: Int): Result<*> {
        val result = setPower8(t)
        return if (result.isSuccess) {
            Result.success(Unit)
        } else {
            Result.failure<Unit>(Throwable(result.failure.toString()))
        }
    }
}